#include "processbar.h"


//double bandwidth = 1024*1024*1.0;

//download
//void download(double filesize,callback_t cb)
//void download(double filesize,callback_t cb)
//{
//    double current = 0.0;
//
//    printf("download begin, current: %lf\n", current);
//    while(current <= filesize)
//    {
//        cb(filesize, current);
//        //从网络中获取数据
//        usleep(100000);
//        current += bandwidth;
//    }
//    printf("\ndownload done, filesize: %lf\n",filesize);
//}

int main()
{
    //version1
    printf("version1:\n");
    Proc1();
    //version2 
    printf("version2:\n");
    Download(100.0*1024*1024);
    //version3
    printf("version3:\n");
    Download2(100.0*1024*1024, Proc2);
    return 0;
}
